﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace S4Store.Domain.ExhibitionKpi
{
    public class ExhibitionYearReport
    {
        public ExhibitionYearReport()
        {
            //ExhibitionWeekDatas = new List<ExhibitionWeekData>();
            MonthReports = new List<ExhibitionReport>();
        }

        public int Year { get; set; }

        public List<ExhibitionReport> MonthReports { get; set; }

        //public virtual List<ExhibitionWeekData> ExhibitionWeekDatas { get; set; }

        /// <summary>
        /// 交车数
        /// </summary>
        public int JCS
        {
            get { return MonthReports.Sum(t => t.JCS); }
        }

        /// <summary>
        /// 交车客户面访调研数
        /// </summary>
        public int JCKHMTDYS
        {
            get { return MonthReports.Sum(t => t.JCKHMTDYS); }
        }

        /// <summary>
        /// 客户调研分析率
        /// </summary>
        public decimal KHDYFXLV
        {
            get
            {
                if (JCS == 0) return 0;
                return (decimal)JCKHMTDYS * 100 / JCS;
            }
        }
        /// <summary>
        /// 广宣计划投放数
        /// </summary>
        public int GXJHTFS {
            get { return MonthReports.Sum(t => t.GXJHTFS); }
        }

        /// <summary>
        /// 广宣实际投放数
        /// </summary>
        public int GXSJTFS
        {
            get { return MonthReports.Sum(t => t.GXSJTFS); }
        }

        /// <summary>
        /// 广  宣  计  划  实  施  率
        /// </summary>
        public decimal GXJHSSLV
        {
            get
            {
                if (GXJHTFS == 0) return 0;
                return (decimal)GXSJTFS * 100 / GXJHTFS;
            }
        }


        /// <summary>
        /// 传统计划投放数
        /// </summary>
        public decimal CTGGJHTFS
        {
            get
            {
                return MonthReports.Sum(t => t.CTGGJHTFS);
            }
        }

        /// <summary>
        /// 传   统  广   告   计  划   执   行   率
        /// </summary>
        public decimal CTGGJHZXLV
        {
            get
            {
                if (CTGGJHTFS == 0) return 0;
                return GXJHSSLV * 100 / CTGGJHTFS;
            }
        }

        /// <summary>
        /// 纸媒广告实际投放数
        /// </summary>
        public decimal CTGGSJTFS
        {
            get
            {
                return MonthReports.Sum(t => t.CTGGSJTFS);
            }
        }
        /// <summary>
        /// 纸媒广告资金投放额   ︵  万  ︶ 
        /// </summary>
        public decimal CTGGZJTFE
        {
            get {
                return MonthReports.Sum(t => t.CTGGZJTFE); 
            }
        }


        /// <summary>
        /// 广告招徕电话批次
        /// </summary>
        public int GGZLDHPC
        {
            get { return MonthReports.Sum(t => t.GGZLDHPC); }
        }

    }
}
